﻿using System.ComponentModel;
using Loki.Utils;

namespace Loki.UI
{
    public abstract class ModalViewModel : ViewModelBase, IModalViewModel
    {
        #region DialogResult

        private static PropertyChangedEventArgs _DialogResultChangedArgs = ObservableHelper.CreateChangedArgs<ModalViewModel>(x => x.DialogResult);

        private static PropertyChangingEventArgs _DialogResultChangingArgs = ObservableHelper.CreateChangingArgs<ModalViewModel>(x => x.DialogResult);

        private bool? _DialogResult;

        public bool? DialogResult
        {
            get
            {
                return _DialogResult;
            }

            set
            {
                if (value != _DialogResult)
                {
                    NotifyChanging(_DialogResultChangingArgs);
                    _DialogResult = value;
                    NotifyChangedAndDirty(_DialogResultChangedArgs);
                }
            }
        }

        #endregion DialogResult
    }
}